import request from '@/utils/request'

// 获取-部门列表
export const getDepartment = () => request.get('/company/department')

// 获取 部门负责人
export const getManagerList = () => request.get('/sys/user/simple')

// 添加列表
export const addDepartment = (data) => request.post('/company/department', data)

// 获取部门详情
// export const updateDepartment = (id) => request.put(`/company/department/${id}`)
export function updateDepartment(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 编辑部门
export function editDepartment(data) {
  return request({
    method: 'put',
    url: `/company/department/${data.id}`,
    data
  })
}

// 删除部门
export const delDepartment = (id) => request.delete(`/company/department/${id}`)
